<%-- 
    Document   : TopicControlPanel
    Created on : Apr 28, 2011, 9:44:33 PM
    Author     : Deena
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/struts-bean" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic" prefix="logic" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Topic Control Panel</title>
        <script type="text/javascript" >
            function hide(){
                //alert("Merge");
                document.getElementById("m").style.visibility = "hidden";
                document.getElementById("newName").style.visibility = "hidden";
                document.getElementById('t').style.visibility = 'hidden';
                document.getElementById('sub').style.visibility = 'hidden';
            }
            function merge(){
                //alert("Merge");
                document.getElementById("m").style.visibility = "visible";
                document.getElementById("newName").style.visibility = "visible";
                document.getElementById("z").style.visibility = "hidden";
            }
            function onRenameTime(){
                document.getElementById('t').style.visibility = 'visible';
                document.getElementById('sub').style.visibility = 'visible';
                document.getElementById('b').style.visibility = 'hidden';
            }
        </script>
    </head>
    <body onload="hide()">
        <table border="1" bgcolor="green">
            <tr>
                <td>Topic ID</td>
                <td>Topic Name</td>
                <td>Is Public Topic </td>
                <td>Is Sticking </td>
                <td>Is Closed</td>
                <td>Num Of Posts</td>
            </tr>
            <html:form action="/TestTopicsAction.do" >
             <logic:iterate name="DisplayTopicActionFormBean" property="topics" id="topic">
                <tr> <td><bean:write name="topic" property="topicid" format="#"></bean:write></td>
                 <td><bean:write name="topic" property="topicname"></bean:write></td>
                 <td><bean:write name="topic" property="ispublic" format="#"></bean:write></td>
                 <td><bean:write name="topic" property="issticky" format="#"></bean:write></td>
                 <td><bean:write name="topic" property="isclosed" format="#"></bean:write></td>
                 <td> <bean:write name="topic" property="numofposts" format="#"></bean:write></td>
                 
                 <td>
                     <html:multibox property="number" >
                         <bean:write name="topic" property="topicid" format="#"></bean:write>
                     </html:multibox>
                 </td>
                </tr>
             </logic:iterate>
        </table><br/><br/>
        <div id="topicName">
            <input type='text' name='name' value='Ziad' id="newName" >
            <input type="submit" name="actionType" value="Merge" id="m">
            <input type="text" id="t" name="rename"  />
            <input type="submit" id="sub" value="Rename"  name="actionType"/>
        </div>
        <html:submit value="Delete" property="actionType"></html:submit>
        <html:submit value="SetClose" property="actionType"></html:submit>
        <html:submit value="SetSticky" property="actionType"></html:submit>

        
        </html:form>
         <!--   <button onclick="addElement();">Rename</button></p>-->
         <button id="z" onclick="merge()">Merge</button>
         <button id="b" onclick="onRenameTime();">rename</button>
</body>
</html>
